package NGUYENTHECUONG.JAVA_FOR_BASE;

import java.util.Scanner;

public class BT04 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		System.out.println("Nhap vao thang :");
		Scanner sc = new Scanner(System.in);
		String tg = sc.nextLine();

		if (tg.isEmpty()) {

			System.out.println("Bat buoc phai nhap vao thang");
		} else {
			int thang = Integer.parseInt(tg);

			System.out.println("Nhap vao nam :");
			tg = sc.nextLine();
			if (tg.isEmpty()) {

				System.out.println("Bat buoc phai nhap vao nam");
			} else {
				int nam = Integer.parseInt(tg);

				if (thang == 4 || thang == 6 || thang == 9 || thang == 11)
					System.out.println("Thang" + thang + "Nam" + nam+"co 30 ngay");
				else if(thang==2){
					if(nam %400==0|| nam%4==0&& nam%100 !=0){
						System.out.println("Thang" + thang + "Nam" + nam+"co 29 ngay");
					}else System.out.println("Thang" + thang + "Nam" + nam+"co 28 ngay");
				} else System.out.println("Thang" + thang + "Nam" + nam+"co 31 ngay");
			}
		}
	}
}
